package com.iis.hrms.persistence;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * The persistent class for the employee database table.
 */
@Entity
@Table(name = "employee")
@NamedQueries({
        @NamedQuery(name = "Employee.findAll", query = "SELECT e FROM Employee e"),
        @NamedQuery(name = "Employee.findById", query = "SELECT e FROM Employee e WHERE e.id = :id"),
        @NamedQuery(name = "Employee.findByName", query = "SELECT e FROM Employee e WHERE e.name = :name"),
        @NamedQuery(name = "Employee.findByBirthday", query = "SELECT e FROM Employee e WHERE e.birthday = :birthday"),
        @NamedQuery(name = "Employee.findByPhoneNumber", query = "SELECT e FROM Employee e WHERE e.phoneNumber = :phoneNumber"),
        @NamedQuery(name = "Employee.findByMobileNumber", query = "SELECT e FROM Employee e WHERE e.mobileNumber = :mobileNumber"),
        @NamedQuery(name = "Employee.findByGpa", query = "SELECT e FROM Employee e WHERE e.gpa = :gpa"),
        @NamedQuery(name = "Employee.findByGpaScale", query = "SELECT e FROM Employee e WHERE e.gpaScale = :gpaScale"),
        @NamedQuery(name = "Employee.findBySalary", query = "SELECT e FROM Employee e WHERE e.salary = :salary"),
        @NamedQuery(name = "Employee.findByExperience", query = "SELECT e FROM Employee e WHERE e.experience = :experience"),
        @NamedQuery(name = "Employee.findByStartDate", query = "SELECT e FROM Employee e WHERE e.startDate = :startDate")})
public class Employee implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(unique = true, nullable = false)
    private String id;

    @Lob()
    @Column(nullable = false)
    private String ability;

    @Lob()
    @Column(nullable = false)
    private String address;

    @Temporal(TemporalType.DATE)
    @Column(nullable = false)
    private Date birthday;

    @Column(nullable = false)
    private int experience;

    @Column(nullable = false)
    private double gpa;

    @Column(name = "gpa_scale", nullable = false)
    private double gpaScale;

    @Column(name = "mobile_number", length = 12)
    private String mobileNumber;

    @Column(nullable = false, length = 255)
    private String name;

    @Column(name = "phone_number", length = 12)
    private String phoneNumber;

    @Column(nullable = false, precision = 10, scale = 2)
    private BigDecimal salary;

    @Temporal(TemporalType.DATE)
    @Column(name = "start_date", nullable = false)
    private Date startDate;

    // bi-directional many-to-one association to Country
    @ManyToOne
    @JoinColumn(name = "id_country", nullable = false)
    private Country country;

    // bi-directional many-to-one association to OvertimeHourRule
    @ManyToOne
    @JoinColumn(name = "id_overtime_hour", nullable = false)
    private OvertimeHourRules overtimeHourRule;

    // bi-directional many-to-one association to OvertimeRule
    @ManyToOne
    @JoinColumn(name = "id_overtime_rules", nullable = false)
    private OvertimeRules overtimeRule;

    // bi-directional many-to-one association to Position
    @ManyToOne
    @JoinColumn(name = "id_position", nullable = false)
    private Position position;

    // bi-directional many-to-one association to Province
    @ManyToOne
    @JoinColumn(name = "id_province", nullable = false)
    private Province province;

    // bi-directional many-to-one association to State
    @ManyToOne
    @JoinColumn(name = "id_state", nullable = false)
    private State state;

    // bi-directional many-to-one association to Status
    @ManyToOne
    @JoinColumn(name = "id_status", nullable = false)
    private Status status;

    // bi-directional many-to-one association to Subject
    @ManyToOne
    @JoinColumn(name = "id_subject", nullable = false)
    private Subject subject;

    // bi-directional many-to-one association to University
    @ManyToOne
    @JoinColumn(name = "id_university", nullable = false)
    private University university;

    // bi-directional many-to-one association to WorkOffice
    @ManyToOne
    @JoinColumn(name = "id_work_office", nullable = false)
    private WorkOffice workOffice;

    // bi-directional many-to-one association to HistoryAbsensi
    @OneToMany(mappedBy = "employee")
    private List<HistoryAbsensi> historyAbsensis;

    // bi-directional many-to-one association to HistoryLembur
    @OneToMany(mappedBy = "employee")
    private List<HistoryLembur> historyLemburs;

    // bi-directional many-to-one association to HistorySalary
    @OneToMany(mappedBy = "employee")
    private List<HistorySalary> historySalaries;

    // bi-directional many-to-one association to MonthSalary
    @OneToMany(mappedBy = "employee")
    private List<MonthSalary> monthSalaries;

    // bi-directional many-to-one association to OrganizationalHierarchy
    @OneToMany(mappedBy = "employee1")
    private List<OrganizationalHierarchy> organizationalHierarchies1;

    // bi-directional many-to-one association to OrganizationalHierarchy
    @OneToMany(mappedBy = "employee2")
    private List<OrganizationalHierarchy> organizationalHierarchies2;

    public Employee() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getAbility() {
        return this.ability;
    }

    public void setAbility(String ability) {
        this.ability = ability;
    }

    public String getAddress() {
        return this.address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Date getBirthday() {
        return this.birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public int getExperience() {
        return this.experience;
    }

    public void setExperience(int experience) {
        this.experience = experience;
    }

    public double getGpa() {
        return this.gpa;
    }

    public void setGpa(double gpa) {
        this.gpa = gpa;
    }

    public double getGpaScale() {
        return this.gpaScale;
    }

    public void setGpaScale(double gpaScale) {
        this.gpaScale = gpaScale;
    }

    public String getMobileNumber() {
        return this.mobileNumber;
    }

    public void setMobileNumber(String mobileNumber) {
        this.mobileNumber = mobileNumber;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhoneNumber() {
        return this.phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public BigDecimal getSalary() {
        return this.salary;
    }

    public void setSalary(BigDecimal salary) {
        this.salary = salary;
    }

    public Date getStartDate() {
        return this.startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Country getCountry() {
        return this.country;
    }

    public void setCountry(Country country) {
        this.country = country;
    }

    public OvertimeHourRules getOvertimeHourRule() {
        return this.overtimeHourRule;
    }

    public void setOvertimeHourRule(OvertimeHourRules overtimeHourRule) {
        this.overtimeHourRule = overtimeHourRule;
    }

    public OvertimeRules getOvertimeRule() {
        return this.overtimeRule;
    }

    public void setOvertimeRule(OvertimeRules overtimeRule) {
        this.overtimeRule = overtimeRule;
    }

    public Position getPosition() {
        return this.position;
    }

    public void setPosition(Position position) {
        this.position = position;
    }

    public Province getProvince() {
        return this.province;
    }

    public void setProvince(Province province) {
        this.province = province;
    }

    public State getState() {
        return this.state;
    }

    public void setState(State state) {
        this.state = state;
    }

    public Status getStatus() {
        return this.status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    public Subject getSubject() {
        return this.subject;
    }

    public void setSubject(Subject subject) {
        this.subject = subject;
    }

    public University getUniversity() {
        return this.university;
    }

    public void setUniversity(University university) {
        this.university = university;
    }

    public WorkOffice getWorkOffice() {
        return this.workOffice;
    }

    public void setWorkOffice(WorkOffice workOffice) {
        this.workOffice = workOffice;
    }

    public List<HistoryAbsensi> getHistoryAbsensis() {
        return this.historyAbsensis;
    }

    public void setHistoryAbsensis(List<HistoryAbsensi> historyAbsensis) {
        this.historyAbsensis = historyAbsensis;
    }

    public List<HistoryLembur> getHistoryLemburs() {
        return this.historyLemburs;
    }

    public void setHistoryLemburs(List<HistoryLembur> historyLemburs) {
        this.historyLemburs = historyLemburs;
    }

    public List<HistorySalary> getHistorySalaries() {
        return this.historySalaries;
    }

    public void setHistorySalaries(List<HistorySalary> historySalaries) {
        this.historySalaries = historySalaries;
    }

    public List<MonthSalary> getMonthSalaries() {
        return this.monthSalaries;
    }

    public void setMonthSalaries(List<MonthSalary> monthSalaries) {
        this.monthSalaries = monthSalaries;
    }

    public List<OrganizationalHierarchy> getOrganizationalHierarchies1() {
        return this.organizationalHierarchies1;
    }

    public void setOrganizationalHierarchies1(
            List<OrganizationalHierarchy> organizationalHierarchies1) {
        this.organizationalHierarchies1 = organizationalHierarchies1;
    }

    public List<OrganizationalHierarchy> getOrganizationalHierarchies2() {
        return this.organizationalHierarchies2;
    }

    public void setOrganizationalHierarchies2(
            List<OrganizationalHierarchy> organizationalHierarchies2) {
        this.organizationalHierarchies2 = organizationalHierarchies2;
    }

}